/* cli config */
const sourceMap = process.env.ENV === "testing"; // if testing mode, need map
const resolve = dir => require("path").join(__dirname, dir);
module.exports = {
  publicPath: "./",
  configureWebpack: {
    resolve: {
      alias: {
        "@": resolve("src")
      }
    },
    externals: {}
  },
  devServer: {
    host: "0.0.0.0",
    port: 8080,
    hot: true,
    hotOnly: true,
    proxy: {
      // 生产
      "/gateway": {
        target: "http://dc.shgyjs.cn:1223/", //"http://10.6.11.30:9810",
        changeOrigin: true
        // pathRewrite: {
        //   "^/api": ""
        // }
      },
      '/classroom': {
        target: 'http://dc.shgyjs.cn:1223/',
        changeOrigin: true,
        pathRewrite: {
          // '^/classroom': '/classroom'
        }
      }
    }, // 设置代理
    overlay: {
      warnings: true,
      errors: true
    }
  },
  filenameHashing: true,
  productionSourceMap: sourceMap
};
